Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

464
Visualizações
ZeroMQ fails to .bind() on Docker on [0.0.0.0:5555] - address already in use. Why?

Got a bit problem with ZeroMQ socket on trying to .bind() on 0.0.0.0:5555 address, when tried to run it in Docker container via a Rancher Cattle.

Every time I try to run it, I'm getting the same error:

zmq.error.ZMQError: Address already in use.

Tried to do EXPOSE 5555 and EXPOSE 5555/tcp in my Dockerfile, but it did not help me.

Here is a part of my code:

...
self.context = zmq.Context()
self.socket = self.context.socket(zmq.PUB)
self.socket.bind('tcp://%s:%d' % ('0.0.0.0', 5555))
...

Maybe somebody had the same problem. How to solve it?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

ZeroMQ API defines 3-ways to go:

Assigning a local address to a socket

When assigning a local address to a socket using zmq_bind() with the tcp:// transport, the endpoint shall be interpreted as an interface followed by a colon and the TCP port number to use.

An interface may be specified by either of the following:
- The wild-card *, meaning all available interfaces.
- The primary IPv4 address assigned to the interface, in its numeric representation.
- The interface name as defined by the operating system.

Interface names are not standardised in any way and should be assumed to be arbitrary and platform dependent. On Win32 platforms no short interface names exist, thus only the primary IPv4 address may be used to specify an interface.

So, at least one ought make the job progress.

over 4 years ago · Santiago Trujillo Relatório

0

After two hours of debugging i tried to make .bind_to_random_port() and noticed, that my app in Docker starts via 4 Gunicorn workers. So after first worker started, three another workers can not bind to the same port. Be aware of binding to only one port while you have multiple threaded or multiple workers application.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda